package com.tidc.seaserverweb.controller;

import com.tidc.seaservermodel.entity.Fres;
import com.tidc.seaservermodel.exception.TidcAuthorityException;
import com.tidc.seaservermodel.exception.TidcBadParent;
import com.tidc.seaserverservice.service.SecondaryMessageService;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

//这个@xxxx叫注解
//@RestController 的功能是标注这个类是controller
@RestController
//@RequestMapping 的功能是标注这个controller的映射路径
@RequestMapping("/secondary/message")
//@CrossOrigin(origins = "*",maxAge = 3600,allowCredentials = "true")
public class SecondaryMessageController {
    @Resource
    private SecondaryMessageService supervisorMessageService;
    //@GetMapping 的功能是标注这个方法的映射路径
    @GetMapping("/email/list")
    public Fres<Map<Object,Object>> getEmailList(@RequestParam("pageSize") int pageSize, @RequestParam("pageNum") int pageNum, Authentication authentication) throws TidcBadParent, TidcAuthorityException {
        return  supervisorMessageService.getEmailList(pageSize,pageNum,authentication);
    }
}
